﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using PolymorphExample;

namespace PolymorphExample
{

    abstract class PowerPointBaseObject
    {
        public int Height { get; set; }
        public int Width { get; set; }

        public abstract void Draw();

        public void PrintSize()
        {
            Console.WriteLine("Height: {0}, Width: {1}", Height, Width);
        }

    }

    class Image : PowerPointBaseObject
    {
        public override void Draw()
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Draw Image");
            Console.ForegroundColor = ConsoleColor.White;
        }
    }

    class Text : PowerPointBaseObject
    {
        public override void Draw()
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Draw Text");
            Console.ForegroundColor = ConsoleColor.White;
;
        }
    }

    class Video : PowerPointBaseObject
    {
        public override void Draw()
        {
            throw new NotImplementedException();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            List<PowerPointBaseObject> objects = new List<PowerPointBaseObject>();

            Image obj1 = new Image()
            {
                Height = 10,
                Width = 10
            };

            //PowerPointBaseObject obj2 = new PowerPointBaseObject
            //{
            //    Height = 10,
            //    Width = 10
            //};

            Text obj3 = new Text()
            {
                Height = 20,
                Width = 20
            };

            objects.Add(obj1);
            //objects.Add(obj2);
            objects.Add(obj3);


            foreach (var baseObject in objects)
            {
                baseObject.Draw();
            }
        }
    }
}
